#ifndef __R_TOOLS_H__
#define __R_TOOLS_H__

#include "Stream/ugdefs.h"
#include "Geometry/UGGeometry.h"

namespace RSuperMap
{
	using namespace UGC;


	class RTools
	{
	private:
		RTools() {}

	public:
		static std::string geometryType2Name(UGint et)
		{
			switch (et)
			{
			case UGC::UGGeometry::Null:
				return "Null";
				break;
			case UGC::UGGeometry::GeoPoint:
				return "GeoPoint";
				break;
			case UGC::UGGeometry::GeoLine:
				return "GeoLine";
				break;
			case UGC::UGGeometry::GeoRegion:
				return "GeoRegion";
				break;
			case UGC::UGGeometry::GeoText:
				return "GeoText";
				break;
			default:
				return "Null";
				break;
			}
		}

		static UGGeometry::Type name2GeometryType(const std::string& name)
		{
			if (name.compare("Null") == 0)
			{
				return UGGeometry::Null;
			}
			if (name.compare("GeoPoint") == 0)
			{
				return UGGeometry::GeoPoint;
			}
			if (name.compare("GeoLine") == 0)
			{
				return UGGeometry::GeoLine;
			}
			if (name.compare("GeoRegion") == 0)
			{
				return UGGeometry::GeoRegion;
			}
			return UGGeometry::Null;
		}
	};
}

#endif
